import request from '@/utils/request'
/**
 * 课时信息api
 */
export default {
  /**
   * 添加课时
   * @returns
   */
  addVideo(video) {
    return request({
      url: '/service-edu/admin/edu/video/add',
      method: 'post',
      data: video
    })
  },
  /**
   * 删除课时
   * @param {*} id
   * @returns
   */
  removeVideoById(id) {
    return request({
      url: `/service-edu/admin/edu/video/deleteVideoById/${id}`,
      method: 'delete'
    })
  },

  /**
   * 更新课时
   * @param {*} chapter
   * @returns
   */
  updateVideoById(video) {
    return request({
      url: '/service-edu/admin/edu/video/UpdateVideoById',
      method: 'put',
      data: video
    })
  },
  /**
   * 查询课时
   * @param {*} id
   * @returns
   */
  getVideoById(id) {
    return request({
      url: `/service-edu/admin/edu/video/getVideoById/${id}`,
      method: 'get',
    })
  },
  /**
   * 根据id删除视频
   * @param {*} id
   * @returns
   */
  deleteVideo(id) {
    return request({
      // baseURL: 'http://127.0.0.1:8160',
      url: `/aliyun-video/admin/aliyun/video/delete/${id}`,
      method: 'delete'
    })
  }
}
